<template>
<h2>登录</h2>
<table border="1">
    <tr>
        <td>用户名</td>
        <td>
            <input type="text" v-model="MemberName">
        </td>
    </tr>
    <tr>
        <td>密码</td>
        <td>
            <input type="password" v-model="Pwd">
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <input type="button" value="登录" @click="login">
        </td>
    </tr>
</table>

</template>
<script setup lang="ts">
import { onMounted,ref } from "vue";
import axios from'axios';

const MemberName=ref("");
const Pwd=ref("");

const login=()=>{

    axios.get('https://localhost:7277/api/Member/Login',
    {
        params:{
            MemberName:MemberName.value,
            Pwd:Pwd.value
        }
    }

    )

    .then(res=>{
        if(res.data>0){
            alert("登录成功");
        }
        else{
            alert("登录失败");
        }
    })

}



</script>